package com.my.chapter15;

public class practice15 {
    static TwoTuple<String,Integer> f(){
        return Tuple.tuple("hi",6);
    }
    static TwoTuple f2(){
        return Tuple.tuple("hi",6);
    }

    public static void main(String[] args) {
        TwoTuple<String,Integer> t1 = f();
        TwoTuple<String,Integer> t2 = f2();
        //Unchecked assignment: 'com.my.chapter15.TwoTuple' to 'com.my.chapter15.TwoTuple<java.lang.String,java.lang.Integer>'
        System.out.println(t1);
        System.out.println(t2);
    }
}

class Tuple{
    public static <A,B> TwoTuple<A,B> tuple(A a,B b){
        return new TwoTuple<>(a,b);
    }

    public static <A,B,C> ThreeTuple<A,B,C> tuple(A a,B b,C c){
        return new ThreeTuple<>(a,b,c);
    }
}

